package com.xy.mainp.novel.fragment.home.widget;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import com.xy.debug.LogUtils;
import com.xy.mainp.ClassfiyBookItemBinding;
import com.xy.mainp.R;
import com.xy.mainp.model.biqu.home.classify.ClassfiyBookItemEntity;

/**
 * Created by John on 2016/12/6.
 */

public class ClassfiyBookItemView extends LinearLayout{

    private ClassfiyBookItemBinding binding;

    public ClassfiyBookItemView(Context context) {
        this(context,null);
    }

    public ClassfiyBookItemView(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public ClassfiyBookItemView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {
        binding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.view_classfiy_book_item,this,true);
    }

    public void setData(ClassfiyBookItemEntity entity){
        binding.setClassfiyEntity(entity);
        LogUtils.i(entity.getBookName());
    }
}
